# import logging
import time
import random
from Case.python_ui.Common.basepage import Basepage
from Case.python_ui.PageLocate.admin_api_gateway_locator import AdminApiGatewayLocator
from Case.python_ui.PageLocate.admin_ticket_management_locator import AdminTicketManagementLocator


class AdminApiGatewayPage(Basepage):
    # 进入apigateway菜单页面
    def enter_apigateway_page(self):
        time.sleep(2)
        doc = "进入apigateway菜单"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_appbinding)
                self.click_element(AdminApiGatewayLocator.click_appbinding, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_api_gateway)
                self.click_element(AdminApiGatewayLocator.click_api_gateway, doc)
                time.sleep(2)
                self.wait_elevisble(AdminApiGatewayLocator.click_appbinding, doc)
                self.click_element(AdminApiGatewayLocator.click_appbinding, doc)
                time.sleep(5)
                continue
        time.sleep(20)
        self.wait_elevisble(AdminApiGatewayLocator.if_app_binding, doc)
        print('b++:', self.get_element(AdminApiGatewayLocator.if_app_binding, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_app_binding, doc).text == 'APP Binding'
        self.wait_elevisble(AdminApiGatewayLocator.if_create_binding, doc)
        print('b++:', self.get_element(AdminApiGatewayLocator.if_create_binding, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_create_binding, doc).text == 'Create Binding'
        self.wait_elevisble(AdminApiGatewayLocator.if_app_name, doc)
        print('b++:', self.get_element(AdminApiGatewayLocator.if_app_name, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_app_name, doc).text == 'APP Name'


    # 锁定app
    def lock_app(self):
        time.sleep(2)
        doc = "进入apigateway菜单"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_api_gateway)
                self.click_element(AdminApiGatewayLocator.click_api_gateway, doc)
                time.sleep(2)
                self.wait_elevisble(AdminApiGatewayLocator.click_appbinding, doc)
                self.click_element(AdminApiGatewayLocator.click_appbinding, doc)
                break
            except:
                self.driver.refresh()
                time.sleep(5)
                continue
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_lock, doc)
        print('lock:', self.get_element(AdminApiGatewayLocator.click_lock, doc).text)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_lock, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_confirm, doc)
        self.click_element(AdminApiGatewayLocator.click_confirm, doc)
        time.sleep(5)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_locked, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_locked, doc).text == 'Locked'
        self.wait_elevisble(AdminApiGatewayLocator.click_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_unlock, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_unlock, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_confirm, doc)
        self.click_element(AdminApiGatewayLocator.click_confirm, doc)

    # 解锁app
    def unlock_app(self):
        time.sleep(2)
        doc = "进入apigateway菜单"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_api_gateway)
                self.click_element(AdminApiGatewayLocator.click_api_gateway, doc)
                time.sleep(2)
                self.wait_elevisble(AdminApiGatewayLocator.click_appbinding, doc)
                self.click_element(AdminApiGatewayLocator.click_appbinding, doc)
                break
            except:
                self.driver.refresh()
                time.sleep(5)
                continue
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_lock, doc)
        print('unlock:',self.get_element(AdminApiGatewayLocator.click_lock, doc).text)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_lock, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_confirm, doc)
        self.click_element(AdminApiGatewayLocator.click_confirm, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_unlock, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_unlock, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_confirm, doc)
        self.click_element(AdminApiGatewayLocator.click_confirm, doc)
        time.sleep(5)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_locked, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_locked, doc).text == 'Normal'

    #进入文档中心
    def enter_document_center(self):
        time.sleep(2)
        doc = "进入文档中心菜单"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_document)
                self.click_element(AdminApiGatewayLocator.click_document, doc)
                time.sleep(2)
                #self.scroll_bar_operation(AdminApiGatewayLocator.click_document_center)
                self.wait_elevisble(AdminApiGatewayLocator.click_document_center, doc)
                self.click_element(AdminApiGatewayLocator.click_document_center, doc)
                break
            except:
                self.driver.refresh()
                time.sleep(5)
                continue
        time.sleep(20)
        self.wait_elevisble(AdminApiGatewayLocator.if_newiframe, doc)
        self.driver.switch_to.frame(self.get_element(AdminApiGatewayLocator.if_newiframe, doc))
        self.wait_elevisble(AdminApiGatewayLocator.if_overview, doc)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_overview, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_overview, doc).text == 'CRE API Overview'
        #self.wait_elevisble(AdminApiGatewayLocator.if_product, doc)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_product, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_product, doc).text == 'Cloud Product & Service Managements APIs'
        #self.wait_elevisble(AdminApiGatewayLocator.if_parameters, doc)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_parameters, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_parameters, doc).text == 'Common Parameters'
        #self.wait_elevisble(AdminApiGatewayLocator.if_use_center, doc)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_use_center, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_use_center, doc).text == 'Customer User Center APIs'
        #self.wait_elevisble(AdminApiGatewayLocator.if_plateform, doc)
        print('lock+:', self.get_element(AdminApiGatewayLocator.if_plateform, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_plateform, doc).text == 'Platform Admin Console APIs'

    #进入plateform data subscription
    def enter_plateform_data_subscription(self):
        time.sleep(2)
        doc = "进入plateform data subscription"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_data_storage_subscription)
                self.click_element(AdminApiGatewayLocator.click_data_storage_subscription, doc)
                time.sleep(2)
                #self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_pds, doc)
                self.click_element(AdminApiGatewayLocator.click_pds, doc)
                break
            except:
                self.driver.refresh()
                time.sleep(5)
                continue
        time.sleep(20)

    # create new功能验证--billing statement
    def create_billing_statement(self):
        doc = "create new功能验证--billing statement"
        self.wait_elevisble(AdminApiGatewayLocator.click_create_new, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_create_new, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_file_type, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_file_type, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_billing_statement, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_billing_statement, doc)
        time.sleep(5)
        self.send_keys(AdminApiGatewayLocator.input_subname, 'aaa', doc)
        time.sleep(5)
        #self.scroll_bar_operation(AdminApiGatewayLocator.input_schedule)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.input_schedule, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_day, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_day, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_end_point)
        self.send_keys(AdminApiGatewayLocator.input_end_point, 'http://oss-id-jakarta-testbed-d01-a.tbops.telkomsigma.co.id/', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_directory)
        self.send_keys(AdminApiGatewayLocator.input_directory, 'billingdetail01', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_access_key)
        self.send_keys(AdminApiGatewayLocator.input_access_key, 'CnxbeueGGAIRufH8', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_secret_key)
        self.send_keys(AdminApiGatewayLocator.input_secret_key, 'FXXnlLn59hOoR1n0lZJMYtE6LJS5bE', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_submit, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_subname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_subname, doc).text == 'aaa'
        time.sleep(5)

    # remove功能验证
    def remove_sub(self):
        doc = "remove sub"
        self.wait_elevisble(AdminApiGatewayLocator.click_remove, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_remove, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_remove_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_remove_ok, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_subname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_subname, doc).text != 'aaa'
        time.sleep(5)


    # create new功能验证--instance_spending_details
    def create_instance_spending_details(self):
        doc = "create new功能验证--instance_spending_details"
        self.wait_elevisble(AdminApiGatewayLocator.click_create_new, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_create_new, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_file_type, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_file_type, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_isd, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_isd, doc)
        time.sleep(5)
        self.send_keys(AdminApiGatewayLocator.input_subname, 'aaa', doc)
        time.sleep(5)
        #self.scroll_bar_operation(AdminApiGatewayLocator.input_schedule)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.input_schedule, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_day, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_day, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_end_point)
        self.send_keys(AdminApiGatewayLocator.input_end_point, 'http://oss-id-jakarta-testbed-d01-a.tbops.telkomsigma.co.id/', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_directory)
        self.send_keys(AdminApiGatewayLocator.input_directory, 'billingdetail01', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_access_key)
        self.send_keys(AdminApiGatewayLocator.input_access_key, 'CnxbeueGGAIRufH8', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_secret_key)
        self.send_keys(AdminApiGatewayLocator.input_secret_key, 'FXXnlLn59hOoR1n0lZJMYtE6LJS5bE', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_submit, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_subname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_subname, doc).text == 'aaa'
        time.sleep(5)


    # edit功能
    def edit_sub(self):
        doc = "edit功能验证"
        self.wait_elevisble(AdminApiGatewayLocator.click_edit, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_subname, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_subname, doc)
        self.send_keys(AdminApiGatewayLocator.input_subname, 'bbb', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_submit, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_subname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_subname, doc).text == 'bbb'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_remove, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_remove, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_remove_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_remove_ok, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_subname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_subname, doc).text != 'bbb'
        time.sleep(5)


    #进入vcenter management
    def enter_vcenter_management(self):
        time.sleep(2)
        doc = "进入vcenter management"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_system_setting)
                self.click_element(AdminApiGatewayLocator.click_system_setting, doc)
                time.sleep(2)
                #self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_vcentermgmt, doc)
                self.click_element(AdminApiGatewayLocator.click_vcentermgmt, doc)
                break
            except:
                self.driver.refresh()
                time.sleep(5)
                continue
        time.sleep(20)


    #搜索vcenter
    def search_vcenter(self):
        time.sleep(2)
        doc = "搜索vcenter"
        self.wait_elevisble(AdminApiGatewayLocator.input_vcentername, doc)
        self.send_keys(AdminApiGatewayLocator.input_vcentername, 'ccbtest', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_vcenter_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_vcenter_name, doc).text == 'ccbtest'
        print('total1:', self.get_element(AdminApiGatewayLocator.if_total_one_items, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_total_one_items, doc).text == 'Total 1 items'
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_vcenter_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_vcenter_name, doc).text != 'ccbtest'
        print('total:', self.get_element(AdminApiGatewayLocator.if_total_one_items, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_total_one_items, doc).text != 'Total 1 items'
        time.sleep(5)

    #查看vcenter详情
    def view_vcenter_details(self):
        doc = "查看vcenter详情"
        self.wait_elevisble(AdminApiGatewayLocator.click_detail, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_detail, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_vcenter, doc)
        assert self.get_element(AdminApiGatewayLocator.if_vcenter, doc).text == 'vCenter'
        assert self.get_element(AdminApiGatewayLocator.if_datastore, doc).text == 'Datastore'
        assert self.get_element(AdminApiGatewayLocator.if_network, doc).text == 'Network'
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_datastore, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_datastore, doc)
        self.send_keys(AdminApiGatewayLocator.input_datastore, '195.3_local_ds', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_datastore, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_datasource_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_datasource_name, doc).text == '195.3_local_ds'
        assert self.get_element(AdminApiGatewayLocator.if_total_one_items, doc).text == 'Total 1 items'
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_datasource_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_datasource_name, doc).text != '195.3_local_ds'
        assert self.get_element(AdminApiGatewayLocator.if_total_one_items, doc).text != 'Total 1 items'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_network, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_network, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_portgroupname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_portgroupname, doc).text == 'Portgroup Name'
        time.sleep(5)

    #进入resource compare query
    def enter_rcq(self):
        time.sleep(2)
        doc = "进入resource compare query"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_rcq)
                self.click_element(AdminApiGatewayLocator.click_rcq, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_operation_mgmt)
                self.click_element(AdminApiGatewayLocator.click_operation_mgmt, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_rcq, doc)
                self.click_element(AdminApiGatewayLocator.click_rcq, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #搜索instance
    def search_instance(self):
        time.sleep(2)
        doc = "搜索instance"
        self.wait_elevisble(AdminApiGatewayLocator.input_instanceid, doc)
        self.send_keys(AdminApiGatewayLocator.input_instanceid, '2074', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_datastore, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_instanceid, doc)
        assert '2074' in self.get_element(AdminApiGatewayLocator.if_instanceid, doc).text
        time.sleep(5)

    #进入ascm data
    def enter_ascm_data(self):
        time.sleep(2)
        doc = "进入ascm data"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_ascm_data)
                self.click_element(AdminApiGatewayLocator.click_ascm_data, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_data_deletion)
                self.click_element(AdminApiGatewayLocator.click_data_deletion, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_ascm_data, doc)
                self.click_element(AdminApiGatewayLocator.click_ascm_data, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #进入cre&ascm data
    def enter_creascm_data(self):
        time.sleep(2)
        doc = "进入cre&ascm data"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_creascm_data)
                self.click_element(AdminApiGatewayLocator.click_creascm_data, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_data_deletion)
                self.click_element(AdminApiGatewayLocator.click_data_deletion, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_creascm_data, doc)
                self.click_element(AdminApiGatewayLocator.click_creascm_data, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #进入cre data
    def enter_cre_data(self):
        time.sleep(2)
        doc = "进入cre data"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_cre_data)
                self.click_element(AdminApiGatewayLocator.click_cre_data, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_data_deletion)
                self.click_element(AdminApiGatewayLocator.click_data_deletion, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_cre_data, doc)
                self.click_element(AdminApiGatewayLocator.click_cre_data, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #查看列表页提示语
    def check_prompt (self):
        doc = "查看列表页提示语"
        self.wait_elevisble(AdminApiGatewayLocator.click_question_mark, doc)
        self.move_mouse_to_element(AdminApiGatewayLocator.click_question_mark)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_question_prompt, doc)
        print('if_question_prompt:', self.get_element(AdminApiGatewayLocator.if_question_prompt, doc).text)
        print('if_exclamation_prompt:', self.get_element(AdminApiGatewayLocator.if_exclamation_prompt, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_question_prompt, doc).text == 'ASCM Data refers to the data of the level-1 organization dimension in ASCM, which includes the ASCM level-1 organization and its cloud resources, resource sets, users, user groups, etc.'
        assert self.get_element(AdminApiGatewayLocator.if_exclamation_prompt, doc).text == 'Please download the template for data import first, and upload the Excel for import after filling in.Download Template'
        time.sleep(5)

    #查看搜索条件
    def check_search_criteria (self):
        doc = "查看搜索条件"
        self.wait_elevisble(AdminApiGatewayLocator.click_search_criteria, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_criteria, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_search_level, doc)
        print('if_question_prompt:', self.get_element(AdminApiGatewayLocator.if_search_level, doc).text)
        print('if_exclamation_prompt:', self.get_element(AdminApiGatewayLocator.if_search_import, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_search_level, doc).text == 'Level-1 Organization Name'
        assert self.get_element(AdminApiGatewayLocator.if_search_import, doc).text == 'Importer'
        time.sleep(5)


    #搜索功能验证
    def search_ascm_data (self):
        doc = "查看搜索条件"
        self.wait_elevisble(AdminApiGatewayLocator.click_search_criteria, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_criteria, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_search_level, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_search_level, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_ascm_data, doc)
        self.send_keys(AdminApiGatewayLocator.input_ascm_data, 'ldhtest32', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ascm_search, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_ascm_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_ascm_name, doc).text == 'ldhtest32'
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ascm_reset, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_ascm_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_ascm_name, doc).text != 'ldhtest32'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_search_criteria, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_criteria, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_search_import, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_search_import, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_ascm_data, doc)
        self.send_keys(AdminApiGatewayLocator.input_ascm_data, 'lwm528675013@163.com', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ascm_search, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_ascm_importer, doc)
        assert self.get_element(AdminApiGatewayLocator.if_ascm_importer, doc).text == 'lwm528675013@163.com'
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ascm_reset, doc)
        time.sleep(5)

    #点击查看log中的apilog
    def view_api_log (self):
        doc = "点击查看log中的apilog"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_apilog, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_apilog, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_request_content, doc)
        assert self.get_element(AdminApiGatewayLocator.if_request_content, doc).text == 'Request Content'
        assert self.get_element(AdminApiGatewayLocator.if_response_content, doc).text == 'Response Content'
        time.sleep(5)

    #查看log的basic information
    def view_basic_info (self):
        doc = "查看log的basic information"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_basic_info, doc)
        assert self.get_element(AdminApiGatewayLocator.if_basic_info, doc).text == 'Basic information'
        assert self.get_element(AdminApiGatewayLocator.if_level, doc).text == 'Level-1 Organization Name'
        assert self.get_element(AdminApiGatewayLocator.if_status, doc).text == 'Status'
        assert self.get_element(AdminApiGatewayLocator.if_creation_time, doc).text == 'Creation Time (UTC+08:00)'
        assert self.get_element(AdminApiGatewayLocator.if_importer, doc).text == 'Importer'
        assert self.get_element(AdminApiGatewayLocator.if_import_time, doc).text == 'Import Time (UTC+08:00)'
        time.sleep(5)

    # 查看log的operational information
    def view_operation_info (self):
        doc = "查看log的operational information"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_operational_information, doc)
        assert self.get_element(AdminApiGatewayLocator.if_operational_information, doc).text == 'Operational Information'
        assert self.get_element(AdminApiGatewayLocator.if_operational_id, doc).text == 'Operation ID'
        assert self.get_element(AdminApiGatewayLocator.if_operator, doc).text == 'Operator'
        assert self.get_element(AdminApiGatewayLocator.if_operator_ip, doc).text == 'Operator IP'
        assert self.get_element(AdminApiGatewayLocator.if_operation_time, doc).text == 'Operation Time (UTC+08:00)'
        assert self.get_element(AdminApiGatewayLocator.if_operation_result, doc).text == 'Operation Result'
        time.sleep(5)

    # 查看log的Data Deletion Detail
    def view_datadeletion_detail (self):
        doc = "查看log的Data Deletion Detail"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_datadeletion_detail, doc)
        assert self.get_element(AdminApiGatewayLocator.if_datadeletion_detail, doc).text == 'Data Deletion Detail'
        assert self.get_element(AdminApiGatewayLocator.if_detail_operational_id, doc).text == 'Operation ID'
        assert self.get_element(AdminApiGatewayLocator.if_data_type, doc).text == 'Data Type'
        assert self.get_element(AdminApiGatewayLocator.if_value, doc).text == 'Value'
        assert self.get_element(AdminApiGatewayLocator.if_detail_status, doc).text == 'Status'
        assert self.get_element(AdminApiGatewayLocator.if_start_time, doc).text == 'Start Time (UTC+08:00)'
        time.sleep(5)

    #查看credata的log的basic information
    def view_cre_basic_info (self):
        doc = "查看credata的log的basic information"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_cre_basic_info, doc)
        print('if_cre_basic_info:', self.get_element(AdminApiGatewayLocator.if_cre_basic_info, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_cre_basic_info, doc).text == 'Basic Information'
        assert self.get_element(AdminApiGatewayLocator.if_cre_account_mail, doc).text == 'Account Email'
        assert self.get_element(AdminApiGatewayLocator.if_cre_status, doc).text == 'Status'
        assert self.get_element(AdminApiGatewayLocator.if_cre_creation_time, doc).text == 'Creation Time (UTC+08:00)'
        assert self.get_element(AdminApiGatewayLocator.if_cre_payment_mode, doc).text == 'Payment Mode'
        assert self.get_element(AdminApiGatewayLocator.if_cre_available_balance, doc).text == 'Available Balance (IDR)'
        assert self.get_element(AdminApiGatewayLocator.if_cre_outstanding_amount, doc).text == 'Outstanding Amount (IDR)'
        assert self.get_element(AdminApiGatewayLocator.if_cre_account_type, doc).text == 'Account Type'
        assert self.get_element(AdminApiGatewayLocator.if_cre_user_name, doc).text == 'User Name'
        assert self.get_element(AdminApiGatewayLocator.if_cre_importer, doc).text == 'Importer'
        assert self.get_element(AdminApiGatewayLocator.if_cre_import_time, doc).text == 'Import Time (UTC+08:00)'
        time.sleep(5)

    # 查看cre log的operational information
    def view_cre_operation_info (self):
        doc = "查看cre log的operational information"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_operational_information, doc)
        assert self.get_element(AdminApiGatewayLocator.if_operational_information, doc).text == 'Operational Information'
        assert self.get_element(AdminApiGatewayLocator.if_cre_operational_id, doc).text == 'Operation ID'
        assert self.get_element(AdminApiGatewayLocator.iif_cre_operator, doc).text == 'Operator'
        assert self.get_element(AdminApiGatewayLocator.if_cre_operator_ip, doc).text == 'Operator IP'
        assert self.get_element(AdminApiGatewayLocator.if_cre_operation_time, doc).text == 'Operation Time (UTC+08:00)'
        assert self.get_element(AdminApiGatewayLocator.if_cre_operation_result, doc).text == 'Operation Result'
        time.sleep(5)

    # 查看cre log的Data Deletion Detail
    def view_cre_datadeletion_detail (self):
        doc = "查看cre log的Data Deletion Detail"
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_datadeletion_detail, doc)
        assert self.get_element(AdminApiGatewayLocator.if_datadeletion_detail, doc).text == 'Data Deletion Detail'
        assert self.get_element(AdminApiGatewayLocator.if_cre_ddetail_operational_id, doc).text == 'Operation ID'
        assert self.get_element(AdminApiGatewayLocator.if_cre_ddata_type, doc).text == 'Data Type'
        assert self.get_element(AdminApiGatewayLocator.if_cre_dvalue, doc).text == 'Value'
        assert self.get_element(AdminApiGatewayLocator.if_cre_detail_status, doc).text == 'Status'
        assert self.get_element(AdminApiGatewayLocator.if_cre_dtart_time, doc).text == 'Start Time (UTC+08:00)'
        time.sleep(5)

    #进入monitoring events
    def enter_monitoring_events(self):
        time.sleep(2)
        doc = "进入monitoring events"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_monitoring_events)
                self.click_element(AdminApiGatewayLocator.click_monitoring_events, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_operation_mgmt)
                self.click_element(AdminApiGatewayLocator.click_operation_mgmt, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_monitoring_events, doc)
                self.click_element(AdminApiGatewayLocator.click_monitoring_events, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #monitoring events页面默认显示
    def check_monitoring_events (self):
        doc = "monitoring events页面默认显示"
        self.wait_elevisble(AdminApiGatewayLocator.if_type_id, doc)
        # print('if_question_prompt:', self.get_element(AdminApiGatewayLocator.if_question_prompt, doc).text)
        # print('if_exclamation_prompt:', self.get_element(AdminApiGatewayLocator.if_exclamation_prompt, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_type_id, doc).text == 'Type ID'
        assert self.get_element(AdminApiGatewayLocator.if_name, doc).text == 'Name'
        assert self.get_element(AdminApiGatewayLocator.if_type, doc).text == 'Type'
        assert self.get_element(AdminApiGatewayLocator.if_monitor_from, doc).text == 'Monitor From'
        assert self.get_element(AdminApiGatewayLocator.if_sla_breach, doc).text == 'SLA Breach'
        assert self.get_element(AdminApiGatewayLocator.if_actions, doc).text == 'Actions'
        time.sleep(5)

    #Monitor Event界面搜索功能
    def search_monitoring_events (self):
        doc = "Monitor Event界面搜索功能"
        self.wait_elevisble(AdminApiGatewayLocator.input_events_name, doc)
        #name = self.get_element(AdminApiGatewayLocator.if_events_name_four, doc).text
        self.send_keys(AdminApiGatewayLocator.input_events_name, 'CRE52798', doc)
        total = self.get_element(AdminApiGatewayLocator.events_sum, doc).text
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_events, doc)
        time.sleep(5)
        assert self.get_element(AdminApiGatewayLocator.if_events_name, doc).text == 'CRE52798'
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_events_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_events_name, 'CRE', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_events, doc)
        time.sleep(5)
        assert 'CRE' in self.get_element(AdminApiGatewayLocator.if_events_name, doc).text
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        time.sleep(5)
        assert self.get_element(AdminApiGatewayLocator.events_sum, doc).text == total
        time.sleep(5)

    #Name字段点击跳转
    def check_events_detail (self):
        doc = "Name字段点击跳转"
        self.wait_elevisble(AdminApiGatewayLocator.if_events_name, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_events_name, doc)
        time.sleep(5)
        #self.wait_elevisble(AdminApiGatewayLocator.if_detail_event_type, doc)
        assert self.get_element(AdminApiGatewayLocator.if_detail_tpye_id, doc).text == 'Type ID'
        assert self.get_element(AdminApiGatewayLocator.if_detail_event_type, doc).text == 'Event Type'
        assert self.get_element(AdminApiGatewayLocator.if_detail_monitor_from, doc).text == 'Monitor From'
        assert self.get_element(AdminApiGatewayLocator.if_detail_sla, doc).text == 'SLA'
        assert self.get_element(AdminApiGatewayLocator.if_detail_notification_template, doc).text == 'Notification Template'
        assert self.get_element(AdminApiGatewayLocator.if_detail_faq, doc).text == 'FAQ'
        time.sleep(5)

    # notification字段的跳转
    def check_notification_detail (self):
        doc = "notification字段的跳转"
        self.wait_elevisble(AdminApiGatewayLocator.click_left_edge, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_left_edge, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_notification, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_notification, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_notification_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_notification_name, doc).text == 'Name'
        assert self.get_element(AdminApiGatewayLocator.if_notification_title, doc).text == 'Notification Title'
        assert self.get_element(AdminApiGatewayLocator.if_notification_type, doc).text == 'Notification Type'
        time.sleep(5)

    # Monitoring  Edit
    def edit_monitoring (self):
        doc = "Monitoring  Edit"
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_monitoring, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_monitoring, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_name, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_name, doc)
        random_num = random.randint(1, 100000)
        monitoring_name = 'CRE' + str(random_num)
        self.send_keys(AdminApiGatewayLocator.input_name, monitoring_name, doc)
        print('mn:', monitoring_name)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_sla, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_sla, doc)
        random_num = random.randint(1, 100)
        slavalue = str(random_num)
        print('slav:', slavalue)
        self.send_keys(AdminApiGatewayLocator.input_sla, slavalue, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_submit_editmonitoring, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_editmonitoring, doc)
        time.sleep(5)
        assert self.get_element(AdminApiGatewayLocator.if_events_name, doc).text == monitoring_name
        assert self.get_element(AdminApiGatewayLocator.if_sla_avlue, doc).text == slavalue
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_monitoring, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_monitoring, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_cancel, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_cancel, doc)
        time.sleep(5)
        assert self.get_element(AdminApiGatewayLocator.if_events_name, doc).text == monitoring_name
        assert self.get_element(AdminApiGatewayLocator.if_sla_avlue, doc).text == slavalue
        time.sleep(5)

    #进入events
    def enter_events(self):
        time.sleep(2)
        doc = "进入events"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_events)
                self.click_element(AdminApiGatewayLocator.click_events, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_operation_mgmt)
                self.click_element(AdminApiGatewayLocator.click_operation_mgmt, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_events, doc)
                self.click_element(AdminApiGatewayLocator.click_events, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #event id 页面默认显示
    def check_events (self):
        doc = "event id 页面默认显示"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_issue, doc)
        # print('if_question_prompt:', self.get_element(AdminApiGatewayLocator.if_question_prompt, doc).text)
        # print('if_exclamation_prompt:', self.get_element(AdminApiGatewayLocator.if_exclamation_prompt, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_issue, doc).text == 'Issue'
        assert self.get_element(AdminApiGatewayLocator.if_information, doc).text == 'Information'
        #self.scroll_bar_operation(AdminApiGatewayLocator.if_discussion)
        #assert self.get_element(AdminApiGatewayLocator.if_discussion, doc).text == 'Discussion'
        time.sleep(5)

    #Action--无法点击
    def disabled_action (self):
        doc = "Action--无法点击"
        self.wait_elevisble(AdminApiGatewayLocator.click_selector, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_selector, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_auto_fix, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_auto_fix, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.disabled_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_selector, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_selector, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_closed, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_closed, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.disabled_menu, doc)
        #self.scroll_bar_operation(AdminApiGatewayLocator.if_discussion)
        #assert self.get_element(AdminApiGatewayLocator.if_discussion, doc).text == 'Discussion'
        time.sleep(5)

    # 四种筛选方式的切换，提示语校验
    def check_select_prompt(self):
        doc = "四种筛选方式的切换，提示语校验"
        self.wait_elevisble(AdminApiGatewayLocator.click_search_input, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_eventid, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_eventid, doc)
        self.wait_elevisble(AdminApiGatewayLocator.eventid_prompt, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_eventname, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_eventname, doc)
        self.wait_elevisble(AdminApiGatewayLocator.eventname_prompt, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_accountemail, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_accountemail, doc)
        self.wait_elevisble(AdminApiGatewayLocator.accountemail_prompt, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_operated_by, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_operated_by, doc)
        self.wait_elevisble(AdminApiGatewayLocator.operated_by_prompt, doc)
        time.sleep(5)

    # 不同的筛选条件去搜索，查看结果
    def check_search_result(self):
        doc = "不同的筛选条件去搜索，查看结果"
        self.wait_elevisble(AdminApiGatewayLocator.eventid_prompt, doc)
        self.send_keys(AdminApiGatewayLocator.eventid_prompt, 'ER2024', doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_events, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_events_id, doc)
        assert 'ER2024' in self.get_element(AdminApiGatewayLocator.if_events_id, doc).text
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_eventname, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_eventname, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.eventname_prompt, doc)
        self.send_keys(AdminApiGatewayLocator.eventname_prompt, 'Metering Error', doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_events, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_events_name, doc)
        assert 'Metering Error' in self.get_element(AdminApiGatewayLocator.if_events_name, doc).text
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_accountemail, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_accountemail, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.accountemail_prompt, doc)
        self.send_keys(AdminApiGatewayLocator.accountemail_prompt, 'test112@qq', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_first_email, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_events, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_account_email, doc)
        assert self.get_element(AdminApiGatewayLocator.if_account_email, doc).text == 'test112@qq.com'
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_input, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_operated_by, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_operated_by, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.operated_by_prompt, doc)
        self.send_keys(AdminApiGatewayLocator.operated_by_prompt, 'min', doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_events, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_left_edge, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_left_edge, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_operated_by, doc)
        assert 'min' in self.get_element(AdminApiGatewayLocator.if_operated_by, doc).text
        time.sleep(5)

    # Events界面的其他字段显示
    def check_events_str(self):
        doc = "Events界面的其他字段显示"
        self.wait_elevisble(AdminApiGatewayLocator.click_left_edge, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_left_edge, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_events_name_str, doc)
        assert self.get_element(AdminApiGatewayLocator.if_events_name_str, doc).text == 'Event Name'
        assert self.get_element(AdminApiGatewayLocator.if_account_email_str, doc).text == 'Account Email'
        assert self.get_element(AdminApiGatewayLocator.if_issue_str, doc).text == 'Issue'
        assert self.get_element(AdminApiGatewayLocator.if_status_str, doc).text == 'Status'
        assert self.get_element(AdminApiGatewayLocator.if_operated_by_str, doc).text == 'Operated By'
        assert self.get_element(AdminApiGatewayLocator.if_actions_str, doc).text == 'Actions'
        time.sleep(5)

    # 查看Related Event显示
    def check_related_event (self):
        doc = "查看Related Event显示"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_related_event, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_related_event, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_related_eventid, doc)
        assert self.get_element(AdminApiGatewayLocator.if_related_eventid, doc).text == 'Event ID'
        assert self.get_element(AdminApiGatewayLocator.if_related_issue, doc).text == 'Issue'
        time.sleep(5)

    def search_related_eventid (self):
        doc = "Related Event的搜索功能"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_related_event, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_related_event, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_events_id, doc)
        self.send_keys(AdminApiGatewayLocator.input_events_id, 'ME', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_related_search, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_related_search, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_related_event_id, doc)
        assert 'ME' in self.get_element(AdminApiGatewayLocator.if_related_event_id, doc).text
        time.sleep(5)

    # related下的Event ID的点击跳转
    def check_related_eventid (self):
        doc = "related下的Event ID的点击跳转"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_related_event, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_related_event, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_related_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_related_event_id, doc)
        time.sleep(5)
        self.switch_to_new_window()
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_issue, doc)
        # print('if_question_prompt:', self.get_element(AdminApiGatewayLocator.if_question_prompt, doc).text)
        # print('if_exclamation_prompt:', self.get_element(AdminApiGatewayLocator.if_exclamation_prompt, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_issue, doc).text == 'Issue'
        assert self.get_element(AdminApiGatewayLocator.if_information, doc).text == 'Information'
        #self.scroll_bar_operation(AdminApiGatewayLocator.if_discussion)
        #assert self.get_element(AdminApiGatewayLocator.if_discussion, doc).text == 'Discussion'
        time.sleep(5)

    # Add New Discussion
    def add_new_discussion (self):
        doc = "Add New Discussion"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_discussion)
        self.send_keys(AdminApiGatewayLocator.input_discussion, '123', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.add_discussion, doc)
        self.wait_elevisble(AdminApiGatewayLocator.add_discussion_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.add_discussion_succ, doc).text == 'Added successfully.'
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.delete_discussion)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.delete_discussion, doc)
        time.sleep(5)

    # edit/delete Discussion
    def edit_delete_discussion (self):
        doc = "edit/delete Discussion"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_discussion)
        self.send_keys(AdminApiGatewayLocator.input_discussion, '123', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.add_discussion, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.edit_discussion)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_discussion, doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.edit_input_discussion, doc)
        self.send_keys(AdminApiGatewayLocator.edit_input_discussion, '1234', doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.submit_discussion)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.submit_discussion, doc)
        self.wait_elevisble(AdminApiGatewayLocator.edit_discussion_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.edit_discussion_succ, doc).text == 'Updated successfully.'
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.delete_discussion)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.delete_discussion, doc)
        self.wait_elevisble(AdminApiGatewayLocator.delete_discussion_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.delete_discussion_succ, doc).text == 'Deleted successfully.'
        time.sleep(5)

    #Trouble Shooting跳转
    def enter_trouble_shooting (self):
        doc = "Trouble Shooting跳转"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.click_trouble_shooting)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_trouble_shooting, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_trouble_shooting, doc)
        print('if_trouble_shooting:', self.get_element(AdminApiGatewayLocator.if_trouble_shooting, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_trouble_shooting, doc).text == 'Trouble-Shooting'
        time.sleep(5)

    #Rules & Scenarios跳转
    def enter_rules_scenarios (self):
        doc = "rules_scenarios跳转"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.click_rules_scenarios)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_rules_scenarios, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_rules_scenarios, doc)
        print('if_rules_scenarios:', self.get_element(AdminApiGatewayLocator.if_rules_scenarios, doc).text)
        assert self.get_element(AdminApiGatewayLocator.if_rules_scenarios, doc).text == 'Rules & Scenarios'
        time.sleep(5)

    #Event Information展示
    def check_event_information (self):
        doc = "Event Information展示"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_info_event_id, doc)
        assert self.get_element(AdminApiGatewayLocator.if_info_event_id, doc).text == 'Event ID'
        assert self.get_element(AdminApiGatewayLocator.if_info_status, doc).text == 'Status'
        assert self.get_element(AdminApiGatewayLocator.if_info_reason, doc).text == 'Reason'
        assert self.get_element(AdminApiGatewayLocator.if_info_edo, doc).text == 'eDO Ticket No.'
        assert self.get_element(AdminApiGatewayLocator.if_info_dev, doc).text == 'Dev Portal Ticket No.'
        assert self.get_element(AdminApiGatewayLocator.if_info_operatedby, doc).text == 'Operated By'
        assert self.get_element(AdminApiGatewayLocator.if_info_last, doc).text == 'Last Updated Time'
        assert self.get_element(AdminApiGatewayLocator.if_info_time, doc).text == 'Time Created'
        assert self.get_element(AdminApiGatewayLocator.if_info_close, doc).text == 'Close Time'
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_info_hide, doc)
        time.sleep(5)
        assert self.get_element(AdminApiGatewayLocator.if_info_open, doc).text == 'Open'
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_info_open, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_info_hide, doc)
        assert self.get_element(AdminApiGatewayLocator.if_info_hide, doc).text == 'Hide'
        time.sleep(5)

    #description--issue
    def check_issue_edit (self):
        doc = "description--issue"
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_info, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_info, doc)
        time.sleep(5)
        is_input = self.get_element(AdminApiGatewayLocator.if_issue_string,doc).tag_name.lower()
        assert is_input not in ["input", "textarea"]

    #Information
    def check_information_edit (self):
        doc = "Information"
        self.wait_elevisble(AdminApiGatewayLocator.click_select_event, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_select_event, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_operated_by, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_operated_by, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_operate, doc)
        self.send_keys(AdminApiGatewayLocator.input_operate, 'Admin', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.search_eventid, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_eventid, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_event_id, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_info, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_info, doc)
        time.sleep(5)
        is_input1 = self.get_element(AdminApiGatewayLocator.if_custid,doc).tag_name.lower()
        assert is_input1 not in ["input", "textarea"]
        time.sleep(5)
        is_input2 = self.get_element(AdminApiGatewayLocator.if_acc_email, doc).tag_name.lower()
        assert is_input2 not in ["input", "textarea"]
        time.sleep(5)
        is_input3 = self.get_element(AdminApiGatewayLocator.if_product_name, doc).tag_name.lower()
        assert is_input3 not in ["input", "textarea"]
        time.sleep(5)
        is_input4 = self.get_element(AdminApiGatewayLocator.if_instance, doc).tag_name.lower()
        assert is_input4 not in ["input", "textarea"]
        time.sleep(5)
        is_input5 = self.get_element(AdminApiGatewayLocator.if_organization, doc).tag_name.lower()
        assert is_input5 not in ["input", "textarea"]
        time.sleep(5)
        is_input6 = self.get_element(AdminApiGatewayLocator.if_handleMsg, doc).tag_name.lower()
        assert is_input6 in ["input", "textarea"]
        time.sleep(5)
        is_input7 = self.get_element(AdminApiGatewayLocator.if_resource_due_date, doc).tag_name.lower()
        assert is_input7 not in ["input", "textarea"]
        time.sleep(5)
        is_input8 = self.get_element(AdminApiGatewayLocator.if_auto_renewal, doc).tag_name.lower()
        assert is_input8  not in ["input", "textarea"]
        time.sleep(5)
        is_input9 = self.get_element(AdminApiGatewayLocator.if_renewal_status, doc).tag_name.lower()
        assert is_input9 not in ["input", "textarea"]
        time.sleep(5)
        is_input10 = self.get_element(AdminApiGatewayLocator.if_exist_in_cre, doc).tag_name.lower()
        assert is_input10 not in ["input", "textarea"]
        time.sleep(5)
        is_input11 = self.get_element(AdminApiGatewayLocator.if_exist_in_ascm, doc).tag_name.lower()
        assert is_input11 not in ["input", "textarea"]
        time.sleep(5)

    #进入organization
    def enter_organization(self):
        time.sleep(2)
        doc = "进入organization"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_organization)
                self.click_element(AdminApiGatewayLocator.click_organization, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_personal_user)
                self.click_element(AdminApiGatewayLocator.click_personal_user, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_organization, doc)
                self.click_element(AdminApiGatewayLocator.click_organization, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #查看个人用户币种属性
    def check_settlement_currency(self):
        doc = "查看个人用户币种属性"
        self.wait_elevisble(AdminApiGatewayLocator.if_settlement_currency, doc)
        assert self.get_element(AdminApiGatewayLocator.if_settlement_currency, doc).text == 'IDR'
        time.sleep(5)

    #进入ep organization
    def enter_ep_organization(self):
        time.sleep(2)
        doc = "进入ep organization"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_ep_organization)
                self.click_element(AdminApiGatewayLocator.click_ep_organization, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_enterprise_user)
                self.click_element(AdminApiGatewayLocator.click_enterprise_user, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_ep_organization, doc)
                self.click_element(AdminApiGatewayLocator.click_ep_organization, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #查看ep用户币种属性
    def check_ep_settlement_currency(self):
        doc = "查看ep用户币种属性"
        self.wait_elevisble(AdminApiGatewayLocator.if_ep_settlement_currency, doc)
        assert self.get_element(AdminApiGatewayLocator.if_ep_settlement_currency, doc).text == 'IDR'
        time.sleep(5)

    #进入bp organization
    def enter_bp_organization(self):
        time.sleep(2)
        doc = "进入bp organization"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_bp_organization)
                self.click_element(AdminApiGatewayLocator.click_bp_organization, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_business_partner)
                self.click_element(AdminApiGatewayLocator.click_business_partner, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_bp_organization, doc)
                self.click_element(AdminApiGatewayLocator.click_bp_organization, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #进入tp organization
    def enter_tp_organization(self):
        time.sleep(2)
        doc = "进入tp organization"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_tp_organization)
                self.click_element(AdminApiGatewayLocator.click_tp_organization, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_tech_partner)
                self.click_element(AdminApiGatewayLocator.click_tech_partner, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_tp_organization, doc)
                self.click_element(AdminApiGatewayLocator.click_tp_organization, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #进入ru organization
    def enter_ru_organization(self):
        time.sleep(2)
        doc = "进入ru organization"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_ru_organization)
                self.click_element(AdminApiGatewayLocator.click_ru_organization, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_reseller_user)
                self.click_element(AdminApiGatewayLocator.click_reseller_user, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_ru_organization, doc)
                self.click_element(AdminApiGatewayLocator.click_ru_organization, doc)
                time.sleep(5)
                continue
        time.sleep(20)


    #进入coupon template
    def enter_coupon_template(self):
        time.sleep(2)
        doc = "进入coupon template"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_coupon_template)
                self.click_element(AdminApiGatewayLocator.click_coupon_template, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_promo_manager)
                self.click_element(AdminApiGatewayLocator.click_promo_manager, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_coupon_template, doc)
                self.click_element(AdminApiGatewayLocator.click_coupon_template, doc)
                time.sleep(5)
                continue
        time.sleep(20)


    #创建coupon增加货币类型
    def create_coupon_set_currency (self):
        doc = "创建coupon增加货币类型"
        self.wait_elevisble(AdminApiGatewayLocator.click_create, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_create, doc)
        time.sleep(5)
        random_no = random.randint(1, 1000)
        coupon_name = 'ydp' + str(random_no)
        self.wait_elevisble(AdminApiGatewayLocator.input_coupon_template, doc)
        self.send_keys(AdminApiGatewayLocator.input_coupon_template, coupon_name, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_fixed_amount, doc)
        time.sleep(5)
        self.send_keys(AdminApiGatewayLocator.input_fixed_amount, '1', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_currency, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_idr, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_idr, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.select_dynamic)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_dynamic, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.click_billing_method)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_billing_method, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.select_subscription)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_subscription, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.click_usable_product)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_usable_product, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.select_all)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_all, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_conpon, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_conpon_template, doc)
        assert 'ydp' in self.get_element(AdminApiGatewayLocator.if_conpon_template, doc).text
        time.sleep(5)

    #disabeld template
    def disabeld_template(self):
        doc = "disabeld template"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_conpon, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_conpon, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_disabled, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_disabled, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_disabled_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_disabled_ok, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_conpon_template, doc)
        assert 'ydp' not in self.get_element(AdminApiGatewayLocator.if_conpon_template, doc).text
        time.sleep(5)

    #进入voucher template
    def enter_voucher_template(self):
        time.sleep(2)
        doc = "进入voucher template"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_voucher_template)
                self.click_element(AdminApiGatewayLocator.click_voucher_template, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_promo_manager)
                self.click_element(AdminApiGatewayLocator.click_promo_manager, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_voucher_template, doc)
                self.click_element(AdminApiGatewayLocator.click_voucher_template, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #创建voucher增加货币类型
    def create_voucher_set_currency (self):
        doc = "创建voucher增加货币类型"
        self.wait_elevisble(AdminApiGatewayLocator.click_create, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_create, doc)
        time.sleep(5)
        random_no = random.randint(1, 1000)
        coupon_name = 'ydp' + str(random_no)
        self.wait_elevisble(AdminApiGatewayLocator.input_coupon_template, doc)
        self.send_keys(AdminApiGatewayLocator.input_coupon_template, coupon_name, doc)
        time.sleep(5)
        self.send_keys(AdminApiGatewayLocator.input_fixed_amount, '1', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_currency, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_idr, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_idr, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.select_voucher_dynamic)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_voucher_dynamic, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_voucher, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_conpon_template, doc)
        assert 'ydp' in self.get_element(AdminApiGatewayLocator.if_conpon_template, doc).text
        time.sleep(5)

    #分配coupon给user
    def distribute_coupon(self):
        doc = "分配coupon给user"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_conpon, doc)
        self.move_mouse_to_element(AdminApiGatewayLocator.click_menu_conpon)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_question, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_question, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_prompt, doc)
        print('que:',self.get_element(AdminApiGatewayLocator.if_prompt, doc).text)
        ques = "Only users with the same currency type as the coupon template are allowed to be selected.\nOnly users with the same currency type as the coupon template will be assigned coupon instances."
        print(ques)
        assert self.get_element(AdminApiGatewayLocator.if_prompt, doc).text == ques
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_acemail, doc)
        self.send_keys(AdminApiGatewayLocator.input_acemail, '1', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_account_email, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_account_email, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute_ok, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_distribute_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_distribute_succ, doc).text == 'Distributed successfully.'
        time.sleep(5)

    #分配voucher给user
    def distribute_voucher(self):
        doc = "分配voucher给user"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_conpon, doc)
        self.move_mouse_to_element(AdminApiGatewayLocator.click_menu_conpon)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_question, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_question, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_prompt, doc)
        print('que:',self.get_element(AdminApiGatewayLocator.if_prompt, doc).text)
        ques = "Only users with the same currency type as the voucher template are allowed to be selected.\nOnly users with the same currency type as the voucher template will be assigned voucher instances."
        print(ques)
        assert self.get_element(AdminApiGatewayLocator.if_prompt, doc).text == ques
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_acemail, doc)
        self.send_keys(AdminApiGatewayLocator.input_acemail, '1', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_account_email, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_account_email, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute_ok, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_distribute_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_distribute_succ, doc).text == 'Distributed successfully.'
        time.sleep(5)
    #选择idr
    def selectot_idr(self):
        doc = "选择idr"
        self.wait_elevisble(AdminApiGatewayLocator.click_selector_currency, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_selector_currency, doc)
        time.sleep(5)
        #self.wait_elevisble(AdminApiGatewayLocator.selector_idr, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.selector_idr, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.selector_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.selector_ok, doc)
        time.sleep(5)

    #选择zar
    def selectot_zar(self):
        doc = "选择zar"
        self.wait_elevisble(AdminApiGatewayLocator.click_selector_currency, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_selector_currency, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.selector_zar, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.selector_zar, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.selector_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.selector_ok, doc)
        time.sleep(5)

    #zar 分配coupon给user
    def zar_distribute_coupon(self):
        doc = "zar 分配coupon给user"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_conpon, doc)
        self.move_mouse_to_element(AdminApiGatewayLocator.click_menu_conpon)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_question, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_question, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_prompt, doc)
        print('que:',self.get_element(AdminApiGatewayLocator.if_prompt, doc).text)
        ques = "Only users with the same currency type as the coupon template are allowed to be selected.\nOnly users with the same currency type as the coupon template will be assigned coupon instances."
        print(ques)
        assert self.get_element(AdminApiGatewayLocator.if_prompt, doc).text == ques
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_acemail, doc)
        self.send_keys(AdminApiGatewayLocator.input_acemail, '1', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_disabled_email, doc)
        time.sleep(5)

    #zar 分配voucher给user
    def zar_distribute_voucher(self):
        doc = "zar 分配voucher给user"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_conpon, doc)
        self.move_mouse_to_element(AdminApiGatewayLocator.click_menu_conpon)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_question, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_question, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_prompt, doc)
        print('que:',self.get_element(AdminApiGatewayLocator.if_prompt, doc).text)
        ques = "Only users with the same currency type as the voucher template are allowed to be selected.\nOnly users with the same currency type as the voucher template will be assigned voucher instances."
        print(ques)
        assert self.get_element(AdminApiGatewayLocator.if_prompt, doc).text == ques
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_acemail, doc)
        self.send_keys(AdminApiGatewayLocator.input_acemail, '1', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_disabled_email, doc)
        time.sleep(5)

    #zar 分配coupon给promo
    def zar_distribute_promo(self):
        doc = "zar 分配coupon给promo"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_conpon, doc)
        self.move_mouse_to_element(AdminApiGatewayLocator.click_menu_conpon)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_promo_crowd, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_promo_crowd, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_promo_crowd_value, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_promo_crowd_value, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_promo_crowd_value, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_promo_crowd_value, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_distribute_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_distribute_ok, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_distribute_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_distribute_succ, doc).text == 'Distributed successfully.'
        time.sleep(5)

    #进入settle amount
    def enter_settle_amount(self):
        time.sleep(2)
        doc = "进入settle amount"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_cousumer_settle_amount)
                self.click_element(AdminApiGatewayLocator.click_cousumer_settle_amount, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_settle_amount)
                self.click_element(AdminApiGatewayLocator.click_settle_amount, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_cousumer_settle_amount, doc)
                self.click_element(AdminApiGatewayLocator.click_cousumer_settle_amount, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #admin端查询BP的结算记录
    def search_settle_overview(self):
        doc = "admin端查询BP的结算记录"
        self.wait_elevisble(AdminApiGatewayLocator.input_company_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_company_name, 'bp222', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_select_name, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_select_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_company_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_company_name, doc).text == 'BP/TP Company Name'
        assert self.get_element(AdminApiGatewayLocator.if_settle_mouth, doc).text == 'Settle Month'
        assert self.get_element(AdminApiGatewayLocator.if_settle_amount, doc).text == 'Settle Amount'
        assert self.get_element(AdminApiGatewayLocator.if_settle_paid, doc).text == 'Settle Paid'
        time.sleep(5)

    #admin端查询BP的detail结算记录
    def search_settle_details(self):
        doc = "admin端查询BP的detail结算记录"
        self.wait_elevisble(AdminApiGatewayLocator.click_details, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_details, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_details_company_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_details_company_name, 'bp222', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_details_select_name, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_details_select_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_search_details, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_search_details, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_details_company_name, doc)
        assert self.get_element(AdminApiGatewayLocator.if_details_company_name, doc).text == 'BP/TP Company Name'
        assert self.get_element(AdminApiGatewayLocator.if_details_settle_mouth, doc).text == 'Settle Record Month'
        assert self.get_element(AdminApiGatewayLocator.if_details_billing_cycle, doc).text == 'Billing Cycle'
        assert self.get_element(AdminApiGatewayLocator.if_details_account_email, doc).text == 'Account Email'
        time.sleep(5)

    #进入role
    def enter_role(self):
        time.sleep(2)
        doc = "进入role"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_role)
                self.click_element(AdminApiGatewayLocator.click_role, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_platform_user)
                self.click_element(AdminApiGatewayLocator.click_platform_user, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_role, doc)
                self.click_element(AdminApiGatewayLocator.click_role, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #搜索字段检索查询
    def search_role(self):
        doc = "admin端查询BP的detail结算记录"
        self.keyboard_event(AdminApiGatewayLocator.input_role_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_role_name, 'yang', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_role_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
        assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_role_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_role_name, 'ydp', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_role_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_rolename, doc)
        assert 'ydp' in self.get_element(AdminApiGatewayLocator.if_rolename, doc).text
        time.sleep(5)
        rolename = self.get_element(AdminApiGatewayLocator.if_rolename, doc).text
        self.keyboard_event(AdminApiGatewayLocator.input_role_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_role_name, rolename, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_role_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_rolename, doc)
        assert self.get_element(AdminApiGatewayLocator.if_rolename, doc).text == rolename

    #创建role
    def create_role(self):
        doc = "创建role"
        self.wait_elevisble(AdminApiGatewayLocator.click_create_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_create_role, doc)
        time.sleep(5)
        random_num = random.randint(1, 100000)
        role_name = 'ydp' + str(random_num)
        self.wait_elevisble(AdminApiGatewayLocator.input_name_role, doc)
        self.send_keys(AdminApiGatewayLocator.input_name_role, role_name, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_next, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_next, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_sub, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_role_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_role_name, role_name, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_role_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_rolename, doc)
        assert self.get_element(AdminApiGatewayLocator.if_rolename, doc).text == role_name
        time.sleep(5)


    #删除role
    def delete_role(self):
        doc = "删除role"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_role, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.delete_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.delete_role, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_del, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_del, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
        assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
        time.sleep(5)

    #编辑role
    def modify_role(self):
        doc = "编辑role"
        self.wait_elevisble(AdminApiGatewayLocator.edit_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_role, doc)
        time.sleep(5)
        random_num = random.randint(1, 100000)
        modify_name = 'ydp' + str(random_num)
        self.keyboard_event(AdminApiGatewayLocator.input_modify_rolename, doc)
        self.send_keys(AdminApiGatewayLocator.input_modify_rolename, modify_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_del, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_del, doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_role_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_role_name, modify_name, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_role_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_rolename, doc)
        assert self.get_element(AdminApiGatewayLocator.if_rolename, doc).text == modify_name
        time.sleep(5)

    #编辑role权限
    def modify_role_perm(self):
        doc = "编辑role权限"
        self.wait_elevisble(AdminApiGatewayLocator.click_menu_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_role, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_role_perm, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_role_perm, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_approval, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_approval, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.confirm_edit_per, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.confirm_edit_per, doc)
        self.wait_elevisble(AdminApiGatewayLocator.mofify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.mofify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)

    # 搜索字段检索查询
    def search_ru_user(self):
        doc = "搜索字段检索查询"
        self.wait_elevisble(AdminApiGatewayLocator.input_email_num, doc)
        self.send_keys(AdminApiGatewayLocator.input_email_num, 'hong', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_email_num, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_accemail, doc)
        assert 'hong' in self.get_element(AdminApiGatewayLocator.if_accemail, doc).text
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_email_num, doc)
        self.send_keys(AdminApiGatewayLocator.input_email_num, '6988', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_email_num, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_phonenum, doc)
        assert '6988' in self.get_element(AdminApiGatewayLocator.if_phonenum, doc).text
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_email_num, doc)
        self.send_keys(AdminApiGatewayLocator.input_email_num, 're6988', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_email_num, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
        assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
        time.sleep(5)


    #进入ru user
    def enter_ru_urer(self):
        time.sleep(2)
        doc = "进入ru user"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_ru_user)
                self.click_element(AdminApiGatewayLocator.click_ru_user, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_reseller_user)
                self.click_element(AdminApiGatewayLocator.click_reseller_user, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_ru_user, doc)
                self.click_element(AdminApiGatewayLocator.click_ru_user, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    # reset passwd
    def reset_passwd(self):
        doc = "reset passwd"
        self.wait_elevisble(AdminApiGatewayLocator.click_reserpasswd, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reserpasswd, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
        self.wait_elevisble(AdminApiGatewayLocator.reset_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.reset_succ, doc).text == 'Reset password successfully.'
        time.sleep(5)

    # # 锁定和解锁用户
    # def ruuser_status(self):
    #     doc = "锁定和解锁用户"
    #     status = self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text
    #     self.wait_elevisble(AdminApiGatewayLocator.click_menu_ruuser, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_ruuser, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.lock_ruuser, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.lock_ruuser, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
    #     assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Locked'
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.click_menu_ruuser, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_ruuser, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.unlock_ruuser, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.unlock_ruuser, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
    #     self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
    #     time.sleep(5)
    #     self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
    #     assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Normal'
    #     time.sleep(5)

    # 锁定和解锁用户
    def ruuser_status(self):
        doc = "锁定和解锁用户"
        status = self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text
        if status == 'Locked':
            self.wait_elevisble(AdminApiGatewayLocator.click_menu_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.unlock_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.unlock_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
            assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Normal'
            self.wait_elevisble(AdminApiGatewayLocator.click_menu_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.lock_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.lock_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
            assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Locked'
            time.sleep(5)
        else:
            self.wait_elevisble(AdminApiGatewayLocator.click_menu_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.lock_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.lock_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
            assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Locked'
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_menu_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_menu_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.unlock_ruuser, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.unlock_ruuser, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_know_del, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_know_del, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.click_reset_ok, doc)
            self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_ok, doc)
            time.sleep(5)
            self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
            assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Normal'
            time.sleep(5)

    #查看用户具体信息
    def view_ruuser(self):
        doc = "查看用户具体信息"
        self.wait_elevisble(AdminApiGatewayLocator.if_accemail, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.if_accemail, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_firstname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_firstname, doc).text == 'First Name'
        assert self.get_element(AdminApiGatewayLocator.if_lastname, doc).text == 'Last Name'
        assert self.get_element(AdminApiGatewayLocator.if_phonenumber, doc).text == 'Phone Number'
        assert self.get_element(AdminApiGatewayLocator.if_postcode, doc).text == 'Post Code'
        assert self.get_element(AdminApiGatewayLocator.if_countryregion, doc).text == 'Country/Region'
        assert self.get_element(AdminApiGatewayLocator.if_stateprovince, doc).text == 'State/Province'
        assert self.get_element(AdminApiGatewayLocator.if_city, doc).text == 'City'
        assert self.get_element(AdminApiGatewayLocator.if_address, doc).text == 'Address'
        time.sleep(5)

    #选择用户状态
    def select_status(self):
        doc = "选择用户状态"
        self.wait_elevisble(AdminApiGatewayLocator.select_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_normal, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_normal, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.clicl_ok_status, doc)
        time.sleep(5)
        for i in range(1):
            try:
                self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
                assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Normal'
                break
            except:
                self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
                assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
                time.sleep(2)
                continue
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.clicl_reset_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.clicl_reset_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_locked, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_locked, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.clicl_ok_status, doc)
        time.sleep(5)
        for i in range(1):
            try:
                self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
                assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Locked'
                break
            except:
                self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
                assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
                time.sleep(2)
                continue
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.clicl_reset_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.clicl_reset_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_inactive, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_inactive, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.clicl_ok_status, doc)
        time.sleep(5)
        for i in range(1):
            try:
                self.wait_elevisble(AdminApiGatewayLocator.ruuser_status, doc)
                assert self.get_element(AdminApiGatewayLocator.ruuser_status, doc).text == 'Inactive'
                break
            except:
                self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
                assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
                time.sleep(2)
                continue
        time.sleep(5)


    #进入custom setting
    def enter_cust_setting(self):
        time.sleep(2)
        doc = "进入custom setting"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_custom_setting)
                self.click_element(AdminApiGatewayLocator.click_custom_setting, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_system_setting)
                self.click_element(AdminApiGatewayLocator.click_system_setting, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_custom_setting, doc)
                self.click_element(AdminApiGatewayLocator.click_custom_setting, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #编辑welcome message
    def edit_wel_msg(self):
        doc = "编辑welcome message"
        self.wait_elevisble(AdminApiGatewayLocator.click_initialization_settings, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_initialization_settings, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_wel_msg, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_wel_msg, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_wel_msg, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_wel_msg, doc)
        random_num = random.randint(1, 100000)
        wel_msg = '#{week},#{month} #{day} #{year}, Welcome back to Whale cloud' + str(random_num)
        self.send_keys(AdminApiGatewayLocator.input_wel_msg, wel_msg, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_preview, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_preview, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.preview_wel_msg, doc)
        print('msg:',self.get_element(AdminApiGatewayLocator.preview_wel_msg, doc).text)
        assert str(random_num) in self.get_element(AdminApiGatewayLocator.preview_wel_msg, doc).text
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.close_preview, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.close_preview, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_edit, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_edit, doc)
        time.sleep(5)


    #编辑default country
    def edit_default_country(self):
        doc = "编辑default country"
        self.wait_elevisble(AdminApiGatewayLocator.click_initialization_settings, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_initialization_settings, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_country, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_country, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_country, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_country, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_country, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_country, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_countryedit, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_countryedit, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)

    #编辑merchant name
    def edit_merchant_name(self):
        doc = "编辑merchant name"
        self.wait_elevisble(AdminApiGatewayLocator.click_initialization_settings, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_initialization_settings, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_merchant_name, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_merchant_name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_merchant_name, doc)
        random_num = random.randint(1, 100000)
        name = 'Flou Cloud New' + str(random_num)
        self.keyboard_event(AdminApiGatewayLocator.input_merchant_name, doc)
        self.send_keys(AdminApiGatewayLocator.input_merchant_name, name, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_merchant_name, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_merchant_name, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)

    #编辑merchant email
    def edit_merchant_email(self):
        doc = "编辑merchant email"
        self.wait_elevisble(AdminApiGatewayLocator.click_initialization_settings, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_initialization_settings, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_email, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_email, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_merchant_email, doc)
        random_num = random.randint(1, 100000)
        email = 'support@floucloud.id' + str(random_num)
        self.keyboard_event(AdminApiGatewayLocator.input_merchant_email, doc)
        self.send_keys(AdminApiGatewayLocator.input_merchant_email, email, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_merchant_name, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_merchant_name, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)


    #进入expense control
    def enter_expense_control(self):
        time.sleep(2)
        doc = "进入expense control"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_expense_control)
                self.click_element(AdminApiGatewayLocator.click_expense_control, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_credit_control)
                self.click_element(AdminApiGatewayLocator.click_credit_control, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_expense_control, doc)
                self.click_element(AdminApiGatewayLocator.click_expense_control, doc)
                time.sleep(5)
                continue
        time.sleep(20)


    #设置最小费用配置
    def set_fixed_value(self):
        doc = "设置最小费用配置"
        self.wait_elevisble(AdminApiGatewayLocator.input_zar, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_zar, doc)
        self.send_keys(AdminApiGatewayLocator.input_zar, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_mzn, doc)
        self.send_keys(AdminApiGatewayLocator.input_mzn, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_idr, doc)
        self.send_keys(AdminApiGatewayLocator.input_idr, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_sar, doc)
        self.send_keys(AdminApiGatewayLocator.input_sar, '0', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_submit_value, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_value, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Modified successfully.'
        time.sleep(10)
        self.wait_elevisble(AdminApiGatewayLocator.click_postpaid, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_postpaid, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_zar_post, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_zar_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_zar_post, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_mzn_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_mzn_post, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_idr_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_idr_post, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_sar_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_sar_post, '0', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_submit_value, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_value, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)

    #进入dunning methods
    def enter_dunning_methods(self):
        time.sleep(2)
        doc = "进入dunning methods"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_dunning_methods)
                self.click_element(AdminApiGatewayLocator.click_dunning_methods, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_credit_control)
                self.click_element(AdminApiGatewayLocator.click_credit_control, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_dunning_methods, doc)
                self.click_element(AdminApiGatewayLocator.click_dunning_methods, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #duuning method设置最小费用配置
    def set_fixed_value_dunning(self):
        doc = "duuning method设置最小费用配置"
        self.scroll_bar_operation(AdminApiGatewayLocator.input_zar)
        self.keyboard_event(AdminApiGatewayLocator.input_zar, doc)
        self.send_keys(AdminApiGatewayLocator.input_zar, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_mzn, doc)
        self.send_keys(AdminApiGatewayLocator.input_mzn, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_idr, doc)
        self.send_keys(AdminApiGatewayLocator.input_idr, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_sar, doc)
        self.send_keys(AdminApiGatewayLocator.input_sar, '0', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_value, doc)
        time.sleep(5)
        self.send_keys(AdminApiGatewayLocator.input_mzn1, '0', doc)
        #self.move_mouse_to_click_element(AdminApiGatewayLocator.click_down, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_value, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Saved successfully.'
        time.sleep(10)
        self.scroll_bar_operation(AdminApiGatewayLocator.click_postpaid)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_postpaid, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.input_zar1_post)
        self.keyboard_event(AdminApiGatewayLocator.input_zar1_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_zar1_post, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_mzn1_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_mzn1_post, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_idr1_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_idr1_post, '0', doc)
        time.sleep(5)
        self.keyboard_event(AdminApiGatewayLocator.input_sar1_post, doc)
        self.send_keys(AdminApiGatewayLocator.input_sar1_post, '0', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_value, doc)
        time.sleep(5)
        self.send_keys(AdminApiGatewayLocator.input_mzn_postnew, '0', doc)
        time.sleep(5)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_submit_value, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_modify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_modify_succ, doc).text == 'Saved successfully.'
        time.sleep(5)

    #进入security setting
    def enter_security_setting(self):
        time.sleep(2)
        doc = "进入security setting"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_security_setting)
                self.click_element(AdminApiGatewayLocator.click_security_setting, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_account_setting)
                self.click_element(AdminApiGatewayLocator.click_account_setting, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_security_setting, doc)
                self.click_element(AdminApiGatewayLocator.click_security_setting, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #security setting页面展示
    def check_sec_setting(self):
        doc = "security setting页面展示"
        self.wait_elevisble(AdminApiGatewayLocator.if_change_passwd, doc)
        assert self.get_element(AdminApiGatewayLocator.if_change_passwd, doc).text == 'Change Password'
        assert self.get_element(AdminApiGatewayLocator.if_authentication, doc).text == '2FA Authentication'
        time.sleep(5)

    #MFA 设置
    def set_mfa(self):
        doc = "MFA 设置"
        self.wait_elevisble(AdminApiGatewayLocator.click_mfa_settings, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_mfa_settings, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.cancel_email, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.cancel_email, doc)
        self.wait_elevisble(AdminApiGatewayLocator.mofify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.mofify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_email, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_email, doc)
        self.wait_elevisble(AdminApiGatewayLocator.mofify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.mofify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.cancel_sms, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.cancel_sms, doc)
        self.wait_elevisble(AdminApiGatewayLocator.mofify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.mofify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_sms, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_sms, doc)
        self.wait_elevisble(AdminApiGatewayLocator.mofify_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.mofify_succ, doc).text == 'Modified successfully.'
        time.sleep(5)


    #设置系统税率
    def set_system_taxrate(self):
        doc = "设置系统税率"
        self.wait_elevisble(AdminApiGatewayLocator.click_currency_taxrate, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_currency_taxrate, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_tax_rate, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_tax_rate, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_taxrate, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_taxrate, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_taxrate, doc)
        random_num = random.randint(1, 100)
        taxrate = str(random_num)
        self.keyboard_event(AdminApiGatewayLocator.input_taxrate, doc)
        self.send_keys(AdminApiGatewayLocator.input_taxrate, taxrate, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_taxrate, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_taxrate, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.taxrate_value, doc)
        print('1:', self.get_element(AdminApiGatewayLocator.taxrate_value, doc).text)
        print('2:', taxrate + '.00%')
        assert self.get_element(AdminApiGatewayLocator.taxrate_value, doc).text == taxrate + '.00%'
        time.sleep(5)


    #编辑时间格式
    def edit_time_format(self):
        doc = "编辑时间格式"
        self.wait_elevisble(AdminApiGatewayLocator.click_date_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_date_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_select_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_select_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.edit_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.edit_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_select_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_select_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_time, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_time, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_time, doc)
        time.sleep(5)

    #Customer Service Agreement选项
    def edit_csa(self):
        doc = "Customer Service Agreement选项"
        self.wait_elevisble(AdminApiGatewayLocator.click_jump_link, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_jump_link, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_csa, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_csa, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_preview, doc)
        assert self.get_element(AdminApiGatewayLocator.if_preview, doc).text == 'Modify this jump link, the affected area as shown below'
        time.sleep(5)

    #搜索列表
    def search_app(self):
        doc = "搜索列表"
        self.wait_elevisble(AdminApiGatewayLocator.input_appname_id, doc)
        self.send_keys(AdminApiGatewayLocator.input_appname_id, 'testapp', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.search_app, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_app, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_appname, doc)
        assert self.get_element(AdminApiGatewayLocator.if_appname, doc).text == 'testapp'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_appname_id, doc)
        self.keyboard_event(AdminApiGatewayLocator.input_appname_id, doc)
        self.send_keys(AdminApiGatewayLocator.input_appname_id, '170658617623589', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.search_app, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_app, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_appid, doc)
        assert self.get_element(AdminApiGatewayLocator.if_appid, doc).text == '170658617623589'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_user_type, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_user_type, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_end_user, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_end_user, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_email, doc)
        self.send_keys(AdminApiGatewayLocator.input_email, 'hofer2New2@qq.com', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.search_app, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_app, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_useremail, doc)
        assert self.get_element(AdminApiGatewayLocator.if_useremail, doc).text == 'hofer2New2@qq.com'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        time.sleep(5)

    # 筛选列表
    def select_app(self):
        doc = "筛选列表"
        self.wait_elevisble(AdminApiGatewayLocator.select_statusapp, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_statusapp, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_normalapp, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_normalapp, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_ok_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_ok_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_status_app, doc)
        assert self.get_element(AdminApiGatewayLocator.if_status_app, doc).text == 'Normal'
        time.sleep(5)
        #self.wait_elevisble(AdminApiGatewayLocator.click_reset, doc)
        #self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        self.refresh_page()
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_usertype, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_usertype, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_enduser, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_enduser, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_ok_user, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_ok_user, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_user, doc)
        assert self.get_element(AdminApiGatewayLocator.if_user, doc).text == 'End User'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset, doc)
        time.sleep(5)


    # 列表status字段筛选
    def select_status_data(self):
        doc = "列表status字段筛选"
        self.wait_elevisble(AdminApiGatewayLocator.select_status_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status_data, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_undeleted, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_undeleted, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_deleting, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_abnormal, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_data, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.sum_data, doc)
        assert self.get_element(AdminApiGatewayLocator.sum_data, doc).text == 'Total 4 items'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_status_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status_data, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_data, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_data, doc)
        time.sleep(5)
        self.scroll_bar_operation(AdminApiGatewayLocator.sum_data)
        assert self.get_element(AdminApiGatewayLocator.sum_data, doc).text == 'Total 9 items'
        time.sleep(5)


    #进入my tickets
    def enter_my_tickets(self):
        time.sleep(2)
        doc = "进入my tickets"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_my_tickets)
                self.click_element(AdminApiGatewayLocator.click_my_tickets, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_tickets)
                self.click_element(AdminApiGatewayLocator.click_tickets, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_my_tickets, doc)
                self.click_element(AdminApiGatewayLocator.click_my_tickets, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #Transfer Internally
    def transfer_internally(self):
        doc = "Transfer Internally"
        self.wait_elevisble(AdminApiGatewayLocator.click_transfer, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_transfer, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_support, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_support, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_support, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_support, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_remarks, doc)
        self.send_keys(AdminApiGatewayLocator.input_remarks, 'test', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_transfer, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_transfer, doc)
        time.sleep(5)

    # Transfer to other team
    def transfer_to_otherteam(self):
        doc = "Transfer to other team"
        self.wait_elevisble(AdminApiGatewayLocator.click_transfer, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_transfer, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_transfer_tot, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_transfer_tot, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_support, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_support, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_support, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_support, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_remarks, doc)
        self.send_keys(AdminApiGatewayLocator.input_remarks, 'test', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_transfer, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_transfer, doc)
        time.sleep(5)

    # 对Ignore状态的实例取消忽略
    def cancel_ignore_event(self):
        doc = "对Ignore状态的实例取消忽略"
        self.wait_elevisble(AdminApiGatewayLocator.select_event_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_event_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.reset_event, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.reset_event, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_ignored, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_ignored, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_ignored, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_ignored, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_eventid, doc)
        eventid = self.get_element(AdminApiGatewayLocator.if_eventid, doc).text
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_event_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_event_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_cancel_ignored, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_cancel_ignored, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_cancel, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_cancel, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_event_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_event_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.reset_event, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.reset_event, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_ignored, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_ignored, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_eventid, doc)
        self.send_keys(AdminApiGatewayLocator.input_eventid, eventid, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.search_eventid, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_eventid, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_event_status, doc)
        assert self.get_element(AdminApiGatewayLocator.if_event_status, doc).text == 'ReOpen'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_event_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_event_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ignore, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ignore, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_reason, doc)
        self.send_keys(AdminApiGatewayLocator.input_reason, 'test', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.submit_ignore, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.submit_ignore, doc)
        time.sleep(5)

    # Action--Cancel
    def action_cancel(self):
        doc = "#TL707179 | Action--Cancel"
        self.wait_elevisble(AdminApiGatewayLocator.click_selector, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_selector, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_ignored, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_ignored, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_event_id, doc)
        eventid = self.get_element(AdminApiGatewayLocator.if_event_id, doc).text
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.event_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.event_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_cancel_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_cancel_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_cancel, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_cancel, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_selector, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_selector, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_status, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_status, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_eventid, doc)
        self.send_keys(AdminApiGatewayLocator.input_eventid, eventid, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.search_eventid, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.search_eventid, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_event_status, doc)
        assert self.get_element(AdminApiGatewayLocator.if_event_status, doc).text == 'ReOpen'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.event_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.event_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ignore, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ignore, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.input_reason, doc)
        self.send_keys(AdminApiGatewayLocator.input_reason, 'test', doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.submit_ignore, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.submit_ignore, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_event_status, doc)
        assert self.get_element(AdminApiGatewayLocator.if_event_status, doc).text == 'Ignored'
        time.sleep(5)

    #点击查看cre&ascm log
    def view_creascm_log (self):
        doc = "点击查看cre&ascm log"
        self.wait_elevisble(AdminApiGatewayLocator.select_status_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status_data, doc)
        time.sleep(3)
        self.wait_elevisble(AdminApiGatewayLocator.select_undeleted, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_undeleted, doc)
        time.sleep(3)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_data, doc)
        time.sleep(3)
        for i in range(1):
            try:
                self.wait_elevisble(AdminApiGatewayLocator.if_nodata, doc)
                assert self.get_element(AdminApiGatewayLocator.if_nodata, doc).text == 'No Data'
                break
            except:
                self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
                log = self.get_elements(AdminApiGatewayLocator.click_log, doc)
                print(log.get_attribute("disabled"))
                assert log.get_attribute("disabled") == 'true'
                continue
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_status_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_status_data, doc)
        time.sleep(3)
        self.wait_elevisble(AdminApiGatewayLocator.click_reset_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_reset_data, doc)
        time.sleep(3)
        self.wait_elevisble(AdminApiGatewayLocator.select_deleting, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_deleting, doc)
        self.wait_elevisble(AdminApiGatewayLocator.select_abnormal, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_abnormal, doc)
        self.wait_elevisble(AdminApiGatewayLocator.select_deleted, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_deleted, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_data, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_data, doc)
        time.sleep(3)
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_log, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_log, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_basic_infoma, doc)
        assert self.get_element(AdminApiGatewayLocator.if_basic_infoma, doc).text == 'Basic Information'
        assert self.get_element(AdminApiGatewayLocator.if_oper_info, doc).text == 'Operational Information'
        assert self.get_element(AdminApiGatewayLocator.if_data_deletion, doc).text == 'Data Deletion Detail'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ascm_region, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ascm_region, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.if_ascm_basic_infoma, doc)
        assert self.get_element(AdminApiGatewayLocator.if_ascm_basic_infoma, doc).text == 'Basic Information'
        assert self.get_element(AdminApiGatewayLocator.if_ascm_oper_info, doc).text == 'Operational Information'
        assert self.get_element(AdminApiGatewayLocator.if_acsm_data_deletion, doc).text == 'Data Deletion Detail'
        time.sleep(5)

    #进入pu的org
    def enter_pu_org(self):
        time.sleep(2)
        doc = "进入pu的org"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_pu_org)
                self.click_element(AdminApiGatewayLocator.click_pu_org, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_platform_user)
                self.click_element(AdminApiGatewayLocator.click_platform_user, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_pu_org, doc)
                self.click_element(AdminApiGatewayLocator.click_pu_org, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #编辑用户角色权限
    def edit_pu_role (self):
        doc = "编辑用户角色权限"
        self.wait_elevisble(AdminApiGatewayLocator.click_pu_org_menu, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_pu_org_menu, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_edit_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_edit_role, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_select_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_select_role, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.select_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.select_role, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_ok_role, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_ok_role, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_edit_role_succ, doc)
        assert self.get_element(AdminApiGatewayLocator.if_edit_role_succ, doc).text == 'Edit role successfully.'


    #进入sales amount
    def enter_sales_amount(self):
        time.sleep(2)
        doc = "进入sales amount"
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_sales_amount)
                self.click_element(AdminApiGatewayLocator.click_sales_amount, doc)
                break
            except:
                self.scroll_bar_operation(AdminApiGatewayLocator.click_dashboards)
                self.click_element(AdminApiGatewayLocator.click_dashboards, doc)
                time.sleep(2)
                # self.scroll_bar_operation(AdminApiGatewayLocator.click_pds)
                self.wait_elevisble(AdminApiGatewayLocator.click_sales_amount, doc)
                self.click_element(AdminApiGatewayLocator.click_sales_amount, doc)
                time.sleep(5)
                continue
        time.sleep(20)

    #sales amount报表，支持按币种筛选查看销售额
    def sales_amount_currency (self):
        doc = "sales amount报表，支持按币种筛选查看销售额"
        self.wait_elevisble(AdminApiGatewayLocator.click_currency_sales, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_currency_sales, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_unmzn, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_unmzn, doc)
        self.wait_elevisble(AdminApiGatewayLocator.click_unidr, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_unidr, doc)
        self.wait_elevisble(AdminApiGatewayLocator.click_unsar, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_unsar, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_save_setting, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_save_setting, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_save_setting, doc)
        assert self.get_element(AdminApiGatewayLocator.if_save_setting, doc).text == 'Save the setting successfully.'
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_daily, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_daily, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_currency_sales, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_currency_sales, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_mzn, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_mzn, doc)
        self.wait_elevisble(AdminApiGatewayLocator.click_idr, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_idr, doc)
        self.wait_elevisble(AdminApiGatewayLocator.click_sar, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_sar, doc)
        time.sleep(5)
        self.wait_elevisble(AdminApiGatewayLocator.click_save_setting, doc)
        self.move_mouse_to_click_element(AdminApiGatewayLocator.click_save_setting, doc)
        self.wait_elevisble(AdminApiGatewayLocator.if_save_setting, doc)
        assert self.get_element(AdminApiGatewayLocator.if_save_setting, doc).text == 'Save the setting successfully.'
        time.sleep(5)